package com.jiaai.cloud.file.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 文件信息表
 * </p>
 *
 * @author 佳爱网络科技
 * @since 2017-09-26
 */
@TableName("t_file")
public class TFile extends Model<TFile> {

    private static final long serialVersionUID = 1L;

    public TFile(){}

	public TFile(String fileId, String oldName, Date uploadDate, String urlAddress, Integer customerId) {
		this.fileId = fileId;
		this.oldName = oldName;
		this.uploadDate = uploadDate;
		this.urlAddress = urlAddress;
		this.customerId = customerId;
	}

    /**
     * 文件id, 同文件的新名称
     */
    @TableId(value = "file_id", type = IdType.INPUT)
	private String fileId;
    /**
     * 文件的原名称
     */
	@TableField("old_name")
	private String oldName;
    /**
     * 文件上传的日期
     */
	@TableField("upload_date")
	@JSONField(format = "YYYY-MM-dd HH:mm:ss")
	private Date uploadDate;
    /**
     * 文件下载的地址
     */
	@TableField("url_address")
	private String urlAddress;
	/**
	 * 客户编号
	 */
	@TableField("customer_id")
	private Integer customerId;

	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	public String getOldName() {
		return oldName;
	}

	public void setOldName(String oldName) {
		this.oldName = oldName;
	}

	public Date getUploadDate() {
		return uploadDate;
	}

	public void setUploadDate(Date uploadDate) {
		this.uploadDate = uploadDate;
	}

	public String getUrlAddress() {
		return urlAddress;
	}

	public void setUrlAddress(String urlAddress) {
		this.urlAddress = urlAddress;
	}

	@Override
	protected Serializable pkVal() {
		return this.fileId;
	}

}
